package com.keith.asteria.controller.remoteApi;

import com.keith.asteria.controller.hystrix.RemoteHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import system.SysFunc;
import system.SysUser;

import java.util.List;
import java.util.Map;

/**
 * @ClassName RemoteSysUserApi
 * @Author chenli
 * @Time 2018/10/31
 **/
@FeignClient(name = "service-api", fallback = RemoteHystrix.class)
public interface RemoteSysUserApi {

	@GetMapping("/findUser")
	SysUser findUser(@RequestParam(name = "id") Integer id);

	@PostMapping("/userSave")
	Map<String, Object> userSave(@RequestBody SysUser user);

	@PostMapping("/userUpdate")
	Map<String, Object> userUpdate(@RequestBody SysUser user);

	@PostMapping("/userLogin")
	Map<String, Object> userLogin(@RequestBody SysUser user);

	@GetMapping("/findUserByName")
	SysUser findUserByName(@RequestBody SysUser user);

	/**
	 * 查询用户菜单
	 * @param id
	 * @return
	 */
	@PostMapping("/findUserMenus")
	List<SysFunc> findUserMenus(@RequestParam(name = "id") Integer id);
}
